<template>
      <div>
        <el-form :model="model"  ref="ruleForm" label-width="100px" class="demo-ruleForm page-form">
            <el-row>

                <el-col :span="8">
                    <el-form-item label="入库编号" prop="Number">
                        <el-input v-model="model.Number" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="状态" prop="Status">
                        <el-tag type="warning" v-if="model.Status == '0'">待审核</el-tag>
                        <el-tag type="success" v-else-if="model.Status == '1'">已审核</el-tag>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="经办人" prop="RealName">
                            <el-input v-model="model.RealName" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>

             <el-row>

                <el-col :span="8">
                    <el-form-item label="入库仓" prop="WareHouseId">
                         <el-input v-model="model.WareHouseName" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>


                <el-col :span="8">
                    <el-form-item label="入库类型" prop="WareHouseMode">
                         <el-input v-model="model.WareHouseMode" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="入库日期" prop="WarehouseDate">
                        <el-date-picker type="date" v-model="model.WarehouseDate" :readonly="true"></el-date-picker>
                    </el-form-item>
                </el-col>
                
                <el-col :span="8">
                    <el-form-item label="备注" prop="Remark">
                        <el-input v-model="model.Remark" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

            </el-row>
            
            <el-table :data="tableData" ref="dataForm" v-loading="isLoading" height="360" >
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column  prop="ItemCode" label="编号" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="ItemName" label="名称" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Spec" label="规格" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="UnitOfMeasure" label="单位" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="CurrCount" label="库存" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Amount" label="金额" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="TaxPrice" label="含税单价" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="TaxAmount" label="含税金额" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Count" label="数量" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Price" label="商品单价" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Tax" label="税率" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Remark" label="备注" :show-overflow-tooltip="true"></el-table-column>
            </el-table>

        </el-form>
    </div>
</template>

<script>
export default {
        props:{
            model:{
            require: true,
            type: Object,
        }
        },
        data(){
            return{
                tableData:[],
            }
        },
        created(){
            console.log(this.model);
            this.GetOtherWareHouseItemById()
        },
        methods:{
             GetOtherWareHouseItemById(){
            this.isLoading=true;
            this.$http.get('/api/OtherWareHouse/GetOtherWareHouseItemById',{
                params:{
                    OtherWareHouseId:this.model.Id,
                    WareHouseId:this.model.WareHouseId
                }
            })
            .then(res=>{
                this.isLoading=false;
                this.tableData = res.Data;
            })
        },
        }
}
</script>

<style>

</style>